package bestfriends.tamu;

import java.util.Comparator;
 
public class Result implements Comparable<Result> {
	int id;
	int wins;
	int appearances;
	
	public Result() {
		//default constructor
	}
	
	public Result(int identifier, int numWins, int numAppearances){
		id = identifier;
		wins = numWins;
		appearances = numAppearances;		
	}
	/*
	 * 	public void setId(int newID) {
		id = newID;
	}
	
	public void setName(String newName) {
		name = newName;
	}
	
	public int getId(){
		return id;
	}
	
	public String getName(){
		return name;
	}
	 */
	
	public void setId(int newId){
		id = newId;
	}
	
	public void setWins(int newWins){
		wins = newWins;
	}
	
	public void setAppearances(int newApps){
		appearances = newApps;
	}
	
	public int getId(){
		return id;
	}
	
	public int getWins(){
		return wins;
	}
	
	public int getAppearances(){
		return appearances;
	}
	
	public float getWinPct(){
		return (appearances!=0)? wins/appearances : 0;
	}

	@Override
	public int compareTo(Result another) {
		return Float.compare(another.getWinPct(),this.getWinPct());
	}
	
	
}